package com.znyj.servlet.task.model;

import com.alibaba.fastjson.JSONObject;
import com.znyj.servlet.entity.ScheduledEntity;
import com.znyj.servlet.thrift.ThriftClient;
import com.znyj.servlet.utilsTool.CommonTool;

import java.sql.Timestamp;

/**
 * Created by gaoliwei02 on 17/6/3.
 */
public class ScheduledTaskModel extends AbstractTaskModel {
    public ScheduledEntity scheduledEntity;

    public ScheduledTaskModel(ScheduledEntity scheduledEntity) {
        this.scheduledEntity = scheduledEntity;
    }

    public JSONObject send() {
        long now = new Timestamp(System.currentTimeMillis()).getTime();
        return ThriftClient.taskSendThriftApi(
                scheduledEntity.getUserId(),
                scheduledEntity.getDeviceId(),
                now,
                0,
                scheduledEntity.getControlMsg(),
                scheduledEntity.getUserLocation());
    }
}
